from collections import Counter
from playStats.descriptive_stats import frequency
from playStats.descriptive_stats import mode
from playStats.descriptive_stats import median
from playStats.descriptive_stats import mean
from playStats.descriptive_stats import variance
from playStats.descriptive_stats import std
from playStats.descriptive_stats import quartile


if __name__ == "__main__":
    # #测试频数
    # data = [2,2,2,2,1,1,1,1,1,1,3,3]
    # data = [1,2,3,4]
    # counter = Counter(data)
    # print(counter.most_common())
    # print(counter.most_common()[0][1])
    #
    #
    # #测试频率
    # print(frequency(data))
    #
    # #测试众数
    # ret,count = mode(data)
    # if ret:
    #     print(ret)
    #     print(count)
    # else:
    #     print("众数不存在")

    #测试中位数
    data = [1, 2, 3,5,2,4,5,7,8]
    #print(median(data))

    #测试均值
    #print(mean(data))

    #求四分位数
    print(quartile(data))

    #方差
    print(variance(data))

    #标准差
    print(std(data))